<template>
  <el-card class="box-card">
    <div slot="header" class="clearfix">
      <span>个人信息</span>
    </div>
    <div>
      <div class="text-center">
        <user-avatar-card :user="user"/>
      </div>
      <ul class="list-group list-group-striped">
        <li class="list-group-item">
          <svg-icon icon-class="user"/>
          用户名称
          <div class="pull-right">{{ user.name }}</div>
        </li>
        <li class="list-group-item">
          <svg-icon icon-class="phone"/>
          手机号码
          <div class="pull-right">{{ user.mobile }}</div>
        </li>
        <li class="list-group-item">
          <svg-icon icon-class="email"/>
          用户邮箱
          <div class="pull-right">{{ user.email }}</div>
        </li>
        <!--        <li class="list-group-item">-->
        <!--          <svg-icon icon-class="tree"/>-->
        <!--          所属部门-->
        <!--          <div v-if="user.dept" class="pull-right">{{ user.dept.name }} / {{ postGroup }}</div>-->
        <!--        </li>-->
        <!--        <li class="list-group-item">-->
        <!--          <svg-icon icon-class="peoples"/>-->
        <!--          所属角色-->
        <!--          <div class="pull-right">{{ roleGroup }}</div>-->
        <!--        </li>-->
        <li class="list-group-item">
          <svg-icon icon-class="date"/>
          创建日期
          <div class="pull-right">{{ user.createTime }}</div>
        </li>
      </ul>
    </div>
  </el-card>
</template>
<script>
import {getUserProfile} from "../../../../api/profile";
import UserAvatarCard from "./UserAvatarCard.vue";

export default {
  name: 'ProfileCard',
  components: {UserAvatarCard},
  data() {
    return {
      user: {}
    }
  },
  created() {
    this.getProfile()
  },
  methods: {
    getProfile() {
      getUserProfile().then(response => {
        this.user = response.data
      })
    }
  }
}
</script>
<style scoped lang="scss">
@import "../../../../assets/styles/variables";
::v-deep.box-card{
  .el-card__header {
    height: 45px;
    padding: 10px 15px;
    font-weight: 400;
    font-size: $base-title-font-size;
  }
}
</style>
